package com.nny.alarm.eidt;
import com.nny.alarm.view.DialViewAdapter;


public class ZoneDVAdpater extends DialViewAdapter
{

	private int mnStart = 0;
	private int mnEnd = 0;
	
	public ZoneDVAdpater()
	{
		setZone(0, 0);
	}
	
	public ZoneDVAdpater(int start, int end)
	{
		setZone(start, end);
	}
	
	public void setZone(int start, int end)
	{
		mnStart = start;
		mnEnd = end;
	}
	
	public int getPosition(int value)
	{
		if(value < mnStart || value > mnEnd)
			return 0;
		return value - mnStart;
	}

	@Override
	public int getCount() {
		return (mnEnd - mnStart) + 1;
	}

	@Override
	public String getMarkerText(int position) {
		return getValue(position) + "";
	}

	@Override
	public long getValue(int position) {
		return mnStart + position;
	}
}
